<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>The DOMException class</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="domentityreference.construct.html">DOMEntityReference::__construct</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="class.domimplementation.html">DOMImplementation</a></div>
 <div class="up"><a href="book.dom.html">DOM</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="class.domexception" class="reference">
 <h1 class="title">The DOMException class</h1>
 
 
 <div class="partintro"><p class="verinfo">(PHP 5)</p>
 

  <div class="section" id="domexception.intro">
   <h2 class="title">简介</h2>
   <p class="para">
    DOM operations raise exceptions under particular circumstances, i.e.,
    when an operation is impossible to perform for logical reasons.
   </p>
   <p class="para">
    See also <a href="language.exceptions.html" class="xref">异常处理</a>.
   </p>
  </div>

 
  <div class="section" id="domexception.synopsis">
   <h2 class="title">类摘要</h2>
 

   <div class="classsynopsis">
    <div class="ooclass"></div>
 

    <div class="classsynopsisinfo">
     <span class="ooclass">
      <strong class="classname">DOMException</strong>
     </span>
 

     <span class="ooclass">
      <span class="modifier">extends</span>
      <a href="class.exception.html" class="classname">Exception</a>
     </span>
 
     {</div>

 
    <div class="classsynopsisinfo classsynopsisinfo_comment">/* 属性 */</div>

    <div class="fieldsynopsis">
     <span class="modifier">readonly</span>
     <span class="modifier">public</span>
     <span class="type">int</span>
      <var class="varname"><a href="class.domexception.html#domexception.props.code">$<var class="varname">code</var></a></var>
    ;</div>

 
 
 

    <div class="classsynopsisinfo classsynopsisinfo_comment">/* 继承的方法 */</div>
    <div class="methodsynopsis dc-description">
   <span class="modifier">final</span> <span class="modifier">public</span> <span class="type">string</span><span class="methodname"><a href="exception.getmessage.html" class="methodname">Exception::getMessage</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">final</span> <span class="modifier">public</span> <span class="type">Exception</span><span class="methodname"><a href="exception.getprevious.html" class="methodname">Exception::getPrevious</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">final</span> <span class="modifier">public</span> <span class="type">int</span><span class="methodname"><a href="exception.getcode.html" class="methodname">Exception::getCode</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">final</span> <span class="modifier">public</span> <span class="type">string</span><span class="methodname"><a href="exception.getfile.html" class="methodname">Exception::getFile</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">final</span> <span class="modifier">public</span> <span class="type">int</span><span class="methodname"><a href="exception.getline.html" class="methodname">Exception::getLine</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">final</span> <span class="modifier">public</span> <span class="type">array</span><span class="methodname"><a href="exception.gettrace.html" class="methodname">Exception::getTrace</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">final</span> <span class="modifier">public</span> <span class="type">string</span><span class="methodname"><a href="exception.gettraceasstring.html" class="methodname">Exception::getTraceAsString</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">string</span> <span class="methodname"><a href="exception.tostring.html" class="methodname">Exception::__toString</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">final</span> <span class="modifier">private</span> <span class="type">void</span><span class="methodname"><a href="exception.clone.html" class="methodname">Exception::__clone</a></span>
    ( <span class="methodparam">void</span>
   )</div>

   }</div>

 
  </div>
 

  <div class="section" id="domexception.props">
   <h2 class="title">属性</h2>
   <dl>

    
     <dt id="domexception.props.code"><var class="varname"><var class="varname">code</var></var></dt>

     <dd>

      <p class="para">An integer indicating the type of error generated</p>
     </dd>

    
   </dl>

  </div>

  



 
 </div>
 
</div>
<hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="domentityreference.construct.html">DOMEntityReference::__construct</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="class.domimplementation.html">DOMImplementation</a></div>
 <div class="up"><a href="book.dom.html">DOM</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
